<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
    <title>美策平台</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <link rel="stylesheet" type="text/css" href="../../datepicker/jquery-ui.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/app.css">
    <link rel="stylesheet" type="text/css" href="../../css/my.css">
    <script type="text/javascript" src="../../js/jquery.min.js"></script>
    <script type="text/javascript" src="/pc/js/all.js"></script>
    <style>
        #accountPage .myTable ul {
            padding:0 10px;
            height:45px;
            border-bottom:1px solid #f5f5f5;
            clear:both;
        }
        #accountPage .myTable li {
            padding:10px 5px;
            list-style:none;
            color:#555555;
            font-size:16px;
            font-weight:bolder;
            float:left;
        }
        #accountPage .myTable li img {
            padding:0 5px;
            padding-right:0px;
            height:22px;
        }
        #accountPage .myTable li.addTime {
            font-size:10px;
            line-height:20px;
            float:right;
        }
    </style>
</head>
<body>
<!--
    制作者：九哥
    页面：我的账户-账单
    时间：2019-07-30
-->





<!----------我的账户账单---------->
<div id="accountPage">
    <div id="accountTitle">
        <b>我的账户-充值</b>
        <img src="../../images/return.png" id="accountRtn">
    </div>
    <div class="myTable" id="history">
        <!--<ul>-->
            <!--<li>-->
                <!--<img src="/h5/images/acc-icon-zfb.png" height="25">-->
            <!--</li>-->
            <!--<li>支付宝</li>-->
            <!--<li class="checked">√</li>-->
        <!--</ul>-->
    </div>
</div>
<div  id="zfb"></div>
<!----------我的账户账单---------->





<!----------错误提示---------->
<div id="errMsg"></div>
<!----------错误提示---------->
</body>
<script type="text/javascript" src="../../js/app.js"></script>
<script type="text/javascript" src="../../js/cache.js"></script>
<script type="text/javascript" src="../../js/mysetPageChange.js"></script>
<script type="text/javascript" src="../../js/myset2.js"></script>
</html>

<script>
    (function(){
        getHistory();
    })();
    function getHistory(){
        var userInfo = cacheGet('userInfo'); //获取用户信息
        if (userInfo==null || userInfo.token=='undefined') {
            window.location.href = '/h5/login/login.html';
        }
        var type = getUrlParam('type');
        var formData = {
            app_access:app_access,
            token:userInfo.token,
            type:userInfo.type,
            cate:userInfo.cate,
            operType:type
        };
        $.ajax({
            type: 'post',
            url: getDomain() + 'history',
            data: formData,
            success: function(res){
                //console.log(res); return;
                if (res.code!=0) {
                    console.log(res.msg);
                    return
                }
                var resData = res.data;
                console.log(resData);
                var i, h = '';
                for (i=0;i<resData.length;i++) {
                    h += '<ul>';
                    h += '<li> <img src="/h5/images/acc-icon-zfb.png" height="25"> </li>';
                    h += '<li>'+resData[i].typeName+'：'+resData[i].money+'元</li>';
                    h += '<li class="addTime">'+resData[i].createTime+'</li>';
                    h += '</ul>';
                }
                $('#history').html(h);
            },
            error: function(){
                console.log('操作失败！'); return;
            }
        });
    }
    /**
     * 地址前缀
     * */
    function getDomain(){
        return '/api/my/account/';
    }
</script>